<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
	<div class="wrapper wrapper-content animated fadeInRight">
		<div class="row">
			<div class="col-sm-12">
				<div class="ibox float-e-margins">
					<div class="ibox-content">
						<form class="form-horizontal" id="oauth2Form">
							<div class="form-group">
								<label class="col-sm-2 control-label" for="clientId">客户端Id</label>
								<div class="col-sm-4">
									<input class="form-control" id="clientId" name="clientId"
										type="text" placeholder="clientId"
										th:value="${client.clientId}" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="name">客户端Name</label>
								<div class="col-sm-4">
									<input class="form-control" id="fromPath" name="name"
										type="text" placeholder="name" th:value="${client.name}" />
								</div>
								<label class="col-sm-2 control-label" for="clientSecret">客户端安全码</label>
								<div class="col-sm-4">
									<input class="form-control" id="clientSecret"
										name="clientSecret" type="text" placeholder="clientSecret"
										th:value="${client.clientSecret}" />
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="redirectUri">授权成功重定向URL</label>
								<div class="col-sm-10">
									<input class="form-control" id="redirectUri" name="redirectUri"
										type="text" placeholder="redirectUri"
										th:value="${client.redirectUri}" />
								</div>
							</div>
							<div class="form-group">
								<label for="scope" class="col-sm-2 control-label">权限范围</label>
								<div class="col-sm-4">
									<select id="scope" name="scope" class="form-control"
										multiple="multiple" th:value="${client.scope}">
										<option value="read"
											th:selected="${#strings.contains(client.scope,'read')}">read</option>
										<option value="write"
											th:selected="${#strings.contains(client.scope,'write')}">write</option>
									</select>
								</div>
								<label for="grantTypes" class="col-sm-2 control-label">权限类型</label>
								<div class="col-sm-4">
									<select id="grantTypes" name="grantTypes" class="form-control"
										multiple="multiple" th:value="${client.grantTypes}">
										<option value="authorization_code"
											th:selected="${#strings.contains(client.grantTypes,'authorization_code')}">authorization_code</option>
										<option value="password"
											th:selected="${#strings.contains(client.grantTypes,'password')}">password</option>
										<option value="refresh_token"
											th:selected="${#strings.contains(client.grantTypes,'refresh_token')}">refresh_token</option>
										<option value="client_credentials"
											th:selected="${#strings.contains(client.grantTypes,'client_credentials')}">client_credentials</option>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label class="col-sm-2 control-label" for="accessTokenValidity">AccessToken有效时长</label>
								<div class="col-sm-4">
									<input class="form-control" id="accessTokenValidity"
										name="accessTokenValidity" type="text"
										placeholder="accessTokenValidity"
										th:value="${client.accessTokenValidity}" />
								</div>
								<label class="col-sm-2 control-label" for="refreshTokenValidity">RefreshToken有效时长</label>
								<div class="col-sm-4">
									<input id="refreshTokenValidity" name="refreshTokenValidity"
										class="form-control" type="text"
										placeholder="refreshTokenValidity"
										th:value="${client.refreshTokenValidity}" />
								</div>
							</div>
							<div class="form-group">
								<label for="trusted" class="col-sm-2 control-label">是否完全信任</label>
								<div class="col-sm-4">
									<select id="trusted" name="trusted" class="form-control"
										th:value="${client.trusted}">
										<option value="0" th:selected="${client.trusted ==false}">否</option>
										<option value="1" th:selected="${client.trusted ==true}">是</option>
									</select>
								</div>
							</div>
							<fieldset>
								<div class="form-group">
									<div class="col-sm-12" align="center">
										<button type="submit" class="btn btn-primary">提交</button>
									</div>
								</div>
							</fieldset>
						</form>
					</div>
				</div>
			</div>
		</div>
	</div>
	<div th:include="include::footer"></div>
	<script type="text/javascript" src="/js/appjs/oauth2/edit.js"></script>
</body>
</html>
